#ifndef TEACHERUI_H
#define TEACHERUI_H

#include <QDialog>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QMessageBox>
#include <QTreeWidgetItem>
#include <math.h>

namespace Ui {
class teacherui;
}

class teacherui : public QDialog
{
    Q_OBJECT

public:
    explicit teacherui(QSqlDatabase* db,QString account,QWidget *parent = nullptr);
    ~teacherui();

private slots:
    void on_btnQuit_clicked();

    void on_cheEdit_stateChanged(int arg1);

    void on_btnReset_clicked();

    void on_btnSubmit_clicked();

    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);

    void on_btnAppendTeacher_clicked();

    void on_btnDeleteTeacher_clicked();

    void on_btnResetTeacher_clicked();

    void on_btnSubmitTeacher_clicked();

    void on_btnScreen_clicked();

    void on_btnFind_clicked();

private:
    Ui::teacherui *ui;

    QString m_account;//记录教师账号
    QSqlDatabase m_db;//数据库连接

    void ini();//初始化界面

    QSqlTableModel* m_teachCourseModel;//课程数据模型
    QSqlTableModel* m_gradeModel;//成绩数据模型
    QSqlTableModel* m_evaModel;//评价数据模型
};

#endif // TEACHERUI_H
